<!DOCTYPE html>
<html>
<head>
    <title>RegExp test() Example</title>
    <script type="text/javascript">
        var text = "cat, bat, sat, fat";        
        var pattern = /.at/;
        
        if (pattern.test(text)){
            alert("The pattern was matched.");
        }

    </script>
</head>
<body>

</body>
</html>